
<div>
<div style="margin-bottom: 20px;">
<?php 
 if($this->country && $this->country->getIdentity()){
    echo $this->translate("List Fields of ").'<span style="font-weight:bold">'.$this->country->getTitle()."</span>";
 }
?>
</div>
<div>
<?php 

 
echo $this->htmlLink(
        array(
        'route'			=>	'default',
        'module'        => 'country',                                   
        'controller'	=>	'manage',
        'action'		=>	'add',
        'c_id'          => $this->country_id
        ),
        $this->translate("+ Add Country Field"),
        array(
            'class' => 'smoothbox country_add_field buttonlink'
        )
);
echo $this->htmlLink(
        array(
        'route'			=>	'default',
        'module'        => 'country',                                   
        'controller'	=>	'manage',
        'action'		=>	'edit-country',
        'cid'          => $this->country_id
        ),
        $this->translate("Edit Country"),
        array(
            'class' => 'smoothbox country_add_field buttonlink'
        )
);

echo $this->htmlLink(
        array(
        'route'			=>	'default',
        'module'        => 'country',                                   
        'controller'	=>	'manage',
        'action'		=>	'photos',
        'cid'          => $this->country_id
        ),
        $this->translate("Photos"),
        array(
            'class' => 'country_add_field buttonlink'
        )
);


echo $this->htmlLink(
        array(
        'route'			=>	'default',
        'module'        => 'country',                                   
        'controller'	=>	'manage',
        'action'		=>	'poll-list',
        'cid'          => $this->country_id
        ),
        $this->translate("Polls"),
        array(
            'class' => 'country_add_field buttonlink'
        )
);


?>
</div>
<br />
<div>

<?php if( $this->paginator->count() > 0): ?>

    <div>
        <?php 
            echo $this->paginationControl($this->paginator);
        ?>
    </div>
    <div class="my_field">
        <table class='admin_table' style="width: 100%;">
        <thead>
          <tr>
            <th class=''>
            	<?php echo $this->translate("Field Name"); ?>
            </th>
            
            <th class=''>
            	<?php echo $this->translate("Creation Date"); ?>
            </th>
            <th class=''>
            	<?php echo $this->translate("Modified Date"); ?>
            </th>
            <th>
              <?php echo $this->translate("Basic Field") ?>
            </th>
            <th>
              <?php echo $this->translate("Options") ?>
            </th>
          </tr>
        </thead>
        <tbody class="field_table_body">
             <?php  foreach ($this->paginator as $item): ?>
                <?php 
                    $field_item = Engine_Api::_()->getItem('country_field', $item->field_id);
                ?>
                <tr>
                    <td>
         	          <?php echo $field_item->getTitle(); ?>
                    </td>
                    <td>
         	          <?php echo $item->creation_date; ?>
                    </td>
                    <td>
         	          <?php echo $item->modified_date; ?>
                    </td>
                    <td>
         	          <?php echo (empty($field_item->parent_id)) ? "Yes":"No"; ?>
                    </td>
                    <td>
                        <?php
                        	echo $this->htmlLink(
                                        array(
                                        'route'			=>	'default',
                                        'module'        => 'country',                                   
                                        'controller'	=>	'admin-country-field',
                                        'action'		=>	'edit',
                                        'cf_id'			=>	$item->getIdentity(),
                                        'format'        =>  'smoothbox'
                                        ),
                                        $this->translate("Edit"),
                                        array(
                                            'class' => 'smoothbox',
                                        )
                         ); 
                         
                         ?>
                         <?php
                        	echo " | ".$this->htmlLink(
                                        array(
                                        'route'			=>	'default',
                                        'module'        => 'country',                                   
                                        'controller'	=>	'admin-country-field',
                                        'action'		=>	'delete',
                                        'cf_id'			=>	$item->getIdentity(),
                                        'format'        =>  'smoothbox'
                                        ),
                                        $this->translate("Delete"),
                                        array(
                                            'class' => 'smoothbox',
                                        )
                         ); 
                         
                         ?>
                         
                    </td>
                </tr>

             <?php endforeach; ?>
        </tbody>
        </table>
    </div>
<?php else:?>
    <div class="tip"> <span> <?php echo $this->translate('There are no field this country, plase click add Country fiedl to add.')?></span> </div>
<?php endif; ?>
</div>
</div>